-
Notifications
You must be signed in to change notification settings - Fork 0
ISC-379: ElasticLogSource implementation #2
base: feature/initial-release
Are you sure you want to change the base?
ISC-379: ElasticLogSource implementation #2
Conversation
aninhumer
commented
Jan 30, 2018
•
edited
Loading
edited
- Re-target to master after Initial release #1 is merged.
// $COVERAGE-OFF$ disabled until this is implemented | ||
import scala.util.control.NonFatal | ||
|
||
class ElasticSearchLogSource(id: String, logStreamName: String) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here, maybe id
and logStreamName
should be treated as the same thing?
I'd also suggest that we might want to pass in a query parameter here as well? I'm thinking it might be a good idea to filter out noise prior to use parsing log lines.
val awsLogClient = AWSLogsAsyncClientBuilder.defaultClient() | ||
val logStream = new GetLogEventsRequest() | ||
.withLogStreamName(logStreamName) | ||
.withStartFromHead(false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe where we start from can be defined via our initial stream query?
|
||
object DockerLogSource { | ||
|
||
final case class ProcessTerminated(exitCode: Int) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be in core
module rather than in the instrumentation/docker
module?
* | ||
* @tparam A type of the unmarshalled logging instance | ||
*/ | ||
trait SubscriberPollingLoggingSource[A] extends LoggingSource[A] { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps SubscriberLoggingSource
would be sufficient here?
// $COVERAGE-ON$ | ||
Observable | ||
.fromFuture( | ||
Future(awsLogClient.getLogEventsAsync(logStream).get()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ugly, but what sadly is necessary with Java futures!
c50398e
to
eb52139
Compare